//
//  ObjectCenter.m
//  T
//
//  Created by Toj on 7/25/21.
//

#import "ObjectCenter.h"

@interface ObjectCenter()

@property (weak, nonatomic) id weakObject;

@end

@implementation ObjectCenter

- (instancetype)strongToWeakObject:(id)object; {
    _weakObject = object;
    return self;
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector{
    return [self.weakObject methodSignatureForSelector:aSelector];
}

- (void)forwardInvocation:(NSInvocation *)invocation{
    SEL sel = [invocation selector];
    if ([self.weakObject respondsToSelector:sel]) {
        [invocation invokeWithTarget:self.weakObject];
    }
}

@end
